<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var arr = [1, 23, 1, 1, 1, 3245, 3, 54, 444, 444, 22, 33, 33];

        var arr1 = [];
        arr.forEach(function(item, index) {
            if (arr1.indexOf(item) == -1) {
                arr1.push(item);
            }
        });
        console.log(arr1);

        var arr2 = arr.filter(function(item, index) {
            return index == arr.indexOf(item);
        });
        console.log(arr2);

        var set = new Set(arr);
        var arr3 = Array.from(set);
        console.log(arr3);
























        // var newArr1 = [];
        // for (var i = 0; i < arr.length; i++) {
        //     if (newArr1.indexOf(arr[i]) == -1) {
        //         newArr1.push(arr[i]);
        //     }
        // }
        // console.log(newArr1);

        // var set = new Set(arr);
        // var newArr2 = Array.from(set);
        // console.log(newArr2);

        // var newArr3 = arr.filter(function(item, index) {
        //     return index == arr.indexOf(item);
        // });
        // console.log(newArr3);
    </script>
</body>

</html>